// 基于template/src/views/{{appModules}}/{{pages@DEMPickupView2}}/{{spinalCase page.codeName}}-hook.ts.hbs生成
import { QXEvent } from 'qx-util';
import {
	MPickupView2ActionType,
	MPickupView2Controller,
	IMPickupView2Ability,
	IMPickupView2ControllerParams,
	IParam,
	IViewEvent,
} from '@/core';
import {
	useMPickupView2Props,
	useMPickupView2Basic,
	useMPickupView2ControllerParams,
    useMPickupView2Action,
} from '@/hooks/view/use-mpickup2-view';
import { model } from "./ibiz-sample-0003-sm-pickup-view-2-model";

/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useMPickupView2Props()
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useMPickupView2Basic(model, props)
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
        ...useMPickupView2Action(controller)
    }
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<IViewEvent<MPickupView2ActionType, IMPickupView2Ability>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<IViewEvent<MPickupView2ActionType, IMPickupView2Ability>>
) {
	const params: IMPickupView2ControllerParams<
		MPickupView2ActionType,
		IMPickupView2Ability
	> = useMPickupView2ControllerParams(model, props, evt);
	return new MPickupView2Controller(params);
}